import java.awt.List;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.ArrayList;

import javax.swing.*;


public class Frame extends JFrame implements ActionListener{

	JLabel pula;
	JLabel name1,name2,name3,name4;
	 
	DialogStart dialog;
	DialogName name;
	ArrayList<String> names;
	
	
	public Frame(){
		
		names = new ArrayList<String>();
		setSize(700,500);
		setTitle("Pokergame");
		setLayout(null);
		setResizable(false); 
	
		
		String n1 = null,n2= null,n3=null,n4=null;    // imiona ktore beda wyswietlane na stole
		
		int wPuli=0;									// wartosc puli do wyswietlania
		
		pula = new JLabel("W puli: "+wPuli+" $");
		pula.setBounds(250,200,200,20);
		add(pula);
		
		
			
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		
		
		dialog = new DialogStart();
		while(dialog.isShowing()){
			System.out.print("");
		}
		
		for(int i = 1; i<=dialog.iloscZywych; i++  ){
			name = new DialogName();
			while(name.isShowing()){
				System.out.print("");
			}	
			names.add(name.Name);
		}
		
		names.add("piotr");
		names.add("paulina");
		names.add("maria");
		names.add("bonifacy");
		
		
		name1 = new JLabel(names.get(0));
		name1.setBounds(350,100,100,20);
		add(name1);
		
		name2 = new JLabel(names.get(1));
		name2.setBounds(600,250,100,20);
		add(name2);
		
		
		if(dialog.iloscGraczy>=3){
		name3 = new JLabel(names.get(2));
		name3.setBounds(350,400,100,20);
		add(name3);
			if(dialog.iloscGraczy==4){
				name4 = new JLabel(names.get(3));
				name4.setBounds(100,250,100,20);
				add(name4);
		}
		}
		
		setVisible(true);
		
	}

	
		
	@Override
	public void actionPerformed(ActionEvent e) {
		// TODO Auto-generated method stub
		
	}

}
